<%@ page language="java" contentType="text/html;"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
<style>
div {
	border: 2px solid #a1a1a1;
	padding: 10px 40px;
	background: #dddddd;
	width: 300px;
	border-radius: 25px;
	margin: auto;
}
</style>
</head>

<body>
<%-- 	<html:form action="/register">
		<div align="center">
			<c:if test="${empty param.uid}">

					User ID: <input type="text" name="uid" /> <input type="submit" value="Submit Query" name="submit"/>

			</c:if>
			<c:if test="${not empty param.uid}">
				<c:set var="table"
					value="${fn:substring(uid,0,1)=='R'? 'Rep':'Customer'}"
					scope="session" />
				<c:set var="uid" value="${param.uid}" scope="session" />
				<sql:query dataSource="jdbc/myoracle" var="user">Select * from ${table}Details where user_id='${param.uid}'</sql:query>
				<c:if test="${not empty user.rows}">

					${table=='Rep'?'Representative':table}
					<table bgcolor="33CCCC" border="1" height="72" width="100">
						<tr>
							<td>First Name:</td>
							<td><input type="text" name="first_name" /></td>
						</tr>
						<tr>
							<td>Last Name:</td>
							<td><input type="text" name="last_name" /></td>
						</tr>
						<tr>
							<td>Username:</td>
							<td><input type="text" name="user_name" /></td>
						</tr>
						<tr>
							<td><br />Password:</td>
							<td><input type="password" name="password" /></td>
						</tr>
						<br />


						<c:if test="${table=='Customer'}">
							<tr>
								<td>Security Question:</td>
								<td>${user.rows[0].security_question}</td>
							</tr>
							<tr>
								<td>Security Answer:</td>
								<td><input type="text" name="security_answer" /></td>
							</tr>
							<tr>
								<td>Passcode:</td>
								<td><input type="password" name="passcode" /></td>
							</tr>
						</c:if>

					</table>


					<!-- ifcustomer -->
					<!-- display security question, ask for security answer and passcode  -->
					<input type="submit" value="submit" name="submit"/>

				</c:if>

				<c:if test="${empty user.rows }">
            Invalid User. Press back and retype the User ID.
        </c:if>

			</c:if>

				<input type="submit" value="Back to login" name="submit"/>

		</div>
	</html:form> --%>
	<br/>${sessionScope.error }<br/>
	<html:form action="Register">
	User ID: <html:text property="userID"/>
	<html:submit property="submit" value="Submit"/>
	
	</html:form>
</body>

</html>